# from torchvision import datasets,transforms
# trans_cifar10_train = transforms.Compose([transforms.RandomCrop(32, padding=4),

# dataset_global = datasets.CIFAR10('./data/cifar10',train=True,download=True,transform=trans_cifar10_train)

# print(dataset_global)
# print(len(dataset_global))

# import torch
# x = torch.rand(256,14,14)
# print(x.size()[0])
# import numpy as np
# j = np.random.choice([1,2,3],1,replace=False)
# print(j)
# num_net = 5
# m = 10
# idxs_users = [a for a in range(10)] 
# group_idxs_users = []
# for i in range(num_net):
#     group_users = []
#     start = i*int(m/num_net)
#     end = (i+1)*int(m/num_net)
#     for j in range(start,end):
#         group_users.append(idxs_users[j])
#     group_idxs_users.append(group_users)
# print(group_idxs_users)
# sum_sim = 0.0
#     for k in range(turntable):
#         sim_arr = []
#         idx = 0
#         # sim_sum = 0.0
#         for j in range(k):
#             sim = 0.0
#             s = 0.0
#             dict_a = torch.Tensor(0)
#             dict_b = torch.Tensor(0)
#             cnt = 0
#             for p in net_glob_arr[k].keys():
#                 a = net_glob_arr[k][p]
#                 b = net_glob_arr[j][p]
#                 a = a.view(-1)
#                 b = b.view(-1)


#                 if cnt == 0:
#                     dict_a = a
#                     dict_b = b
#                 else:
#                     dict_a = torch.cat((dict_a, a), dim=0)
#                     dict_b = torch.cat((dict_b, b), dim=0)
                
#                 if cnt % 5 == 0:
#                     sub_a = a
#                     sub_b = b
#                 else:
#                     if not a.equal(b):
#                         sub_a = torch.cat((sub_a, a), dim=0)
#                         sub_b = torch.cat((sub_b, b), dim=0)

#                 if cnt % 5 == 4:
#                     s+= f.cosine_similarity(sub_a, sub_b, dim=0)
#                 cnt += 1
#             # print(sim)
#             s+= f.cosine_similarity(sub_a, sub_b, dim=0)
#             sim = f.cosine_similarity(dict_a, dict_b, dim=0)
#             # print (sim)
#             sim_arr.append(sim)
#             sim_tab[k][j] = sim
#             sim_tab[j][k] = sim
#             sum_sim += copy.deepcopy(s).cpu()
#     l = int(len(net_glob_arr[0].keys())/5) + 1.0
#     sum_sim /= (45.0*l)
turntable = 10
sim_tab = [[0 for _ in range(turntable)] for _ in range(turntable)]
print(sim_tab)